package cn.wolfcode.trip.app.web.controller;

import cn.wolfcode.trip.base.domain.Tag;
import cn.wolfcode.trip.base.service.ITagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/tag")
public class TagController {
    @Autowired
    private ITagService iTagService;

    @GetMapping("/{strategyId}")
    public Object getTag(@PathVariable("strategyId")Long strategyId) {
        List<Tag> tags = iTagService.getStrategyId(strategyId);
        return tags;
    }

    @GetMapping
    public Object getTags() {
        List<Tag> tags = iTagService.listAll();
        return tags;
    }



}
